<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:sistema="http://sistema.com.br/jsf">

	<rich:modalPanel id="modalPanel" width="380" height="200" onshow="#{telaModalMB.campoNome.elementById}.focus();" showWhenRendered="#{telaModalMB.modalPanelShow}">
        <f:facet name="header">
            <h:panelGroup>
                <h:outputText value="#{telaModalMB.titulo}" />
            </h:panelGroup>
        </f:facet>

        <f:facet name="controls">
            <h:panelGroup>
            	<a4j:form id="formMenuPanel">
	                <h:commandLink action="#" immediate="true" id="linkCloseMenu">
	                	<a4j:support event="onclick" reRender="modalPanel" action="#{telaModalMB.cancelar}" immediate="true" ajaxSingle="true" disableDefault="true" />
	                	<h:graphicImage value="../../../static/img/close.png" styleClass="hidelink" />
	                </h:commandLink>
				</a4j:form>
            </h:panelGroup>
        </f:facet>

		<a4j:outputPanel ajaxRendered="true" id="painelMensagemModal" layout="block" style="height: 38px;"> 
				<sistema:mensagem />
 		</a4j:outputPanel>

		<h:form id="#{telaModalMB.campoNome.nameForm}" prependId="#{telaModalMB.campoNome.prependId}">

			<a4j:keepAlive beanName="telaMB"/>
			<a4j:keepAlive beanName="telaModalMB"/>
	
			<fieldset class="lm">

				<br />

				<h:panelGrid columns="2">
		        	<h:outputText value="#{telaModalMB.campoNome.nameDisplay}" />
		        	<h:inputText 	required= "true"
			        	value=      "#{telaModalMB.registro.nome}" 
			        	id=         "#{telaModalMB.campoNome.id}"
			        	size=       "#{telaModalMB.campoNome.sizeMax}" 
			        	maxlength=  "#{telaModalMB.campoNome.maxlength}" 
			        	onkeypress= "#{telaModalMB.campoNome.onkeypress}" >
			        		<f:validateLength minimum="#{telaModalMB.campoNome.sizeMin}"  maximum="#{telaModalMB.campoNome.sizeMax}" /> 
			        </h:inputText>

					<h:outputText value="#{telaModalMB.campoPath.nameDisplay}" />
		        	<h:inputText 	required= "true" 
			        	value=      "#{telaModalMB.registro.path}" 
			        	id=         "#{telaModalMB.campoPath.id}"
			        	size=       "#{telaModalMB.campoPath.sizeMax}" 
			        	maxlength=  "#{telaModalMB.campoPath.maxlength}" 
			        	onkeypress= "#{telaModalMB.campoPath.onkeypress}">
		        			<f:validateLength minimum="#{telaModalMB.campoPath.sizeMin}"  maximum="#{telaModalMB.campoPath.sizeMax}" /> 
				    </h:inputText>
				</h:panelGrid>
				
			</fieldset>

				<br />
	
				<a4j:commandButton id="#{telaModalMB.submit}"   value="#{telaModalMB.submit}"   action="#{telaModalMB.salvar}"   styleClass="w90 pointer" reRender="modalPanel, panelPaginacao, tabelaDados" limitToList="#{telaModalMB.modalPanelShow}" />
				<rich:spacer width="10"/>
				<a4j:commandButton immediate="true" id="#{telaModalMB.cancelar}" value="#{telaModalMB.cancelar}" action="#{telaModalMB.cancelar}" styleClass="w90 pointer" reRender="modalPanel, panelPaginacao, tabelaDados" />

		</h:form>

    </rich:modalPanel>

</html>